#ifndef _CLOCK_H_
#define _CLOCK_H_

#include <stddef.h>

namespace serika 
{
	namespace ut
	{
		class Clock
		{
		public:
			Clock();
			virtual ~Clock();

		public:
			void SetInterval(size_t interval);
			void WaitForNextTick();

			void Start();
			void Stop() { mRunning = false; }
			bool IsRunning() const { return mRunning; }

			size_t GetFrames() const { return mFrames; }
			virtual size_t GetInterval() const = 0;
			virtual size_t GetElapse() const = 0;

		protected:
			virtual void Wait() = 0;

			void UpdateFrame();
			virtual void UpdateTime() = 0;

			virtual void DoStart() = 0;

		protected:
			size_t mInterval;
			size_t mFrames;
			bool mRunning;
		};
	}
}

#endif
